import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Timer;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-09-19
 * Time: 16:00
 */
public class Date {
    public int year;
    public int month;
    public int day;
    public Date(){
        this.year = 2022;
        this.month = 9;
        this.day = 19;

    }

    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }


    public int getYear() {
        return year;
    }

    public int getMonth() {
        return month;
    }

    public int getDay() {
        return day;
    }
    public  String getTime(){
        return getTime();
    }
public void printDate(){
    System.out.println(year+"-"+month+"-"+day);
}
    public boolean isLeapYear(){
        if(year%100==0){
            if(year%400==0){
                return true;
            }
            else if(year%4==0){
                return true;
            }
        }
        return false;
    }
    /*public long between(Date dateStart,Date dateEnd){

    return (long) ((dateEnd.getTime()-dateStart.getTime()));
    }*/

    @Override
    public String toString() {
        return "Date{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }


    public static void main(String[] args) throws ParseException {
        Date today=new Date();
        System.out.println(today.toString());
        today.printDate();
        Date birthday=new Date();
        birthday.year=2003;
        birthday.month=2;
        birthday.day=14;
        birthday.isLeapYear();
        birthday.printDate();
        System.out.println(birthday.isLeapYear());
       /* String date1="2022-09-19";
        String date2="2003-02-14";
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date begin=simpleDateFormat.parse(date1);
        Date end=simpleDateFormat.parse(date2);
        long format=(end.getTime()-begin.getTime())/(1000*60*60*24);
        System.out.println(format);*/



    }
}
